import requests
from bs4 import BeautifulSoup

# B站视频页面URL
url = "https://www.bilibili.com/video/BV1Xx411c7mD"

# 发送HTTP请求获取页面内容
response = requests.get(url)
response.encoding = 'utf-8'
html_content = response.text

# 使用BeautifulSoup解析HTML
soup = BeautifulSoup(html_content, "html.parser")

# 获取视频标题
title = soup.find('h1', class_='video-title').text.strip()

# 获取播放量
play_count = soup.find('span', class_='view').text.strip()

print(f"视频标题: {title}")
print(f"播放量: {play_count}")